home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / buildSelectComponentMM.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  6.2 KB  |  221 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  17 June 1997
  22. //
  23. //  Author:         gf
  24. //
  25. //  Description:
  26. //      This implements the Selection Component Mask Marking Menu.
  27. //
  28.  
  29.  
  30. global proc doSelectComponentMM() 
  31. {
  32.  
  33.     //    Points
  34.     //
  35.     int $maskResult = ( `selectType -q -cv` +
  36.                         `selectType -q -polymeshVertex` +
  37.                         `selectType -q -subdivMeshPoint` +
  38.                         `selectType -q -latticePoint` +
  39.                         `selectType -q -particle` );
  40.  
  41.     // Why can't submenu label have check-boxes???
  42.     //
  43.     menuItem -rp "N" -l "Points" -subMenu true;
  44.         menuItem -rp "N" -l "All Points" 
  45.             -cb $maskResult
  46.             -c "setComponentPickMask \"Point\" #1";
  47.         menuItem -rp "E" -l "CVs" 
  48.             -cb `selectType -q -cv` 
  49.             -c "selectType -cv #1";
  50.         menuItem -rp "SE" -l "Poly Vertices" 
  51.             -cb `selectType -q -polymeshVertex` 
  52.             -c "selectType -polymeshVertex #1";
  53.         menuItem -rp "S" -l "Lattice Points" 
  54.             -cb `selectType -q -latticePoint` 
  55.             -c "selectType -latticePoint #1";
  56.         menuItem -rp "W" -l "Particles"
  57.             -cb `selectType -q -particle` 
  58.             -c "selectType -particle #1";
  59.         menuItem -rp "SW" -l "Subdiv Mesh Points" 
  60.             -cb `selectType -q -subdivMeshPoint` 
  61.             -c "selectType -subdivMeshPoint #1";
  62.     setParent -m ..;
  63.  
  64.  
  65.     //    Parm Points
  66.     //
  67.     menuItem -rp "NE" -l "Parm Points" -subMenu true;
  68.         menuItem -rp "NE" -l "All Parm Points" 
  69.             -cb (`selectType -q -editPoint` +
  70.                 `selectType -q -curveParameterPoint` +
  71.                 `selectType -q -surfaceParameterPoint` )
  72.             -c "setComponentPickMask \"ParmPoint\" #1";
  73.         menuItem -rp "E" -l "Edit Points" 
  74.             -cb `selectType -q -editPoint` 
  75.             -c "selectType -editPoint #1";
  76.         menuItem -rp "S" -l "Curve Points" 
  77.             -cb `selectType -q -cpp` 
  78.             -c "selectType -cpp #1";
  79.         menuItem -rp "W" -l "Surface Points" 
  80.             -cb `selectType -q -spp` 
  81.             -c "selectType -spp #1";
  82.         menuItem -rp "SW" -l "Subdiv Mesh UVs" 
  83.             -cb `selectType -q -smu` 
  84.             -c "selectType -smu #1";
  85.  
  86.     setParent -m ..;
  87.  
  88.  
  89.     //    Lines
  90.     //
  91.     menuItem -rp "E" -l "Lines" -subMenu true;
  92.         menuItem -rp "E" -l "All Lines" 
  93.             -cb (`selectType -q -polymeshEdge` +
  94.                 `selectType -q -isoparm` +
  95.                 `selectType -q -surfaceEdge` )
  96.             -c "setComponentPickMask \"Line\" #1";
  97.         menuItem -rp "S" -l "Poly Edges" 
  98.             -cb `selectType -q -polymeshEdge` 
  99.             -c "selectType -polymeshEdge #1";
  100.         menuItem -rp "W" -l "Isoparms" 
  101.             -cb `selectType -q -isoparm` 
  102.             -c "selectType -isoparm #1";
  103.         menuItem -rp "N" -l "Trim Edges" 
  104.             -cb `selectType -q -surfaceEdge` 
  105.             -c "selectType -surfaceEdge #1";
  106.         menuItem -rp "SE" -l "Springs"
  107.             -cb `selectType -q -springComponent` 
  108.             -c "selectType -springComponent #1";
  109.  
  110.     setParent -m ..;
  111.  
  112.  
  113.     //    Faces
  114.     //
  115.     menuItem -rp "SE" -l "Faces"
  116.             -cb (`selectType -q -facet` +
  117.                  `selectType -q -surfaceFace`)
  118.             -c "selectType -facet #1; selectType -surfaceFace #1";
  119.  
  120.  
  121.     // Hulls
  122.     //
  123.     menuItem -rp "S" -l "Hulls"
  124.             -cb `selectType -q -hull` 
  125.             -c "selectType -hull #1";
  126.  
  127.  
  128.  
  129.     // Pivots
  130.     //
  131.     menuItem -rp "SW" -l "Pivots" -subMenu true;
  132.         menuItem -rp "SW" -l "All Pivots" 
  133.             -cb (`selectType -q -rotatePivot` +
  134.                 `selectType -q -scalePivot` +
  135.                 `selectType -q -jointPivot` )
  136.             -c "setComponentPickMask \"Pivot\" #1";
  137.         menuItem -rp "NW" -l "Rotate Pivots" 
  138.             -cb `selectType -q -rotatePivot` 
  139.             -c "selectType -rotatePivot #1";
  140.         menuItem -rp "NE" -l "Scale Pivots" 
  141.             -cb `selectType -q -scalePivot` 
  142.             -c "selectType -scalePivot #1";
  143.         menuItem -rp "SE" -l "Joint Pivots" 
  144.             -cb `selectType -q -jointPivot` 
  145.             -c "selectType -jointPivot #1";
  146.  
  147.     setParent -m ..;
  148.  
  149.  
  150.     // Handles
  151.     //
  152.     menuItem -rp "W" -l "Handles"
  153.             -cb `selectType -q -selectHandle` 
  154.             -c "selectType -selectHandle #1";
  155.  
  156.  
  157.     //    Misc
  158.     //
  159.     menuItem -rp "NW" -l "Misc." -subMenu true;
  160.         menuItem -rp "NW" -l "All Misc" 
  161.             -cb (`selectType -q -imagePlane` +
  162.                 `selectType -q -localRotationAxis` )
  163.             -c "setComponentPickMask \"Other\" #1";
  164.         menuItem -rp "E" -l "Local Rotation Axes" 
  165.             -cb `selectType -q -localRotationAxis` 
  166.             -c "selectType -localRotationAxis #1";
  167.         menuItem -rp "S" -l "Image Planes" 
  168.             -cb `selectType -q -imagePlane` 
  169.             -c "selectType -imagePlane #1";
  170.  
  171.     setParent -m ..;
  172.  
  173.     //     Overflow
  174.     //
  175.     if (!`menuItem -exists selCompMMOvflItem1`) {
  176.         // Only build overflow items if not already built. This
  177.         // allows for multiple postings on a single hotkey hold.
  178.         menuItem -l "All Components on" 
  179.             -c "setComponentPickMask \"All\" 1"
  180.             selCompMMOvflItem1;
  181.         menuItem -l "All Components off" 
  182.             -c "setComponentPickMask \"All\" 0"
  183.             selCompMMOvflItem2;
  184.         // menuItem -l "Toggle All Components" -enable false;
  185.         menuItem -d true
  186.             selCompMMOvflItem3;
  187.         menuItem -l "Save to shelf" 
  188.             -c "saveComponentMaskToShelf"
  189.             selCompMMOvflItem4;
  190.         menuItem -d true
  191.             selCompMMOvflItem5;
  192.         menuItem -l "Select Objects" 
  193.             -c "selectMode -object"
  194.             selCompMMOvflItem6;
  195.     }
  196.     setParent -m ..;
  197. }
  198.  
  199.  
  200. global proc buildSelectComponentMM()
  201. //
  202. // Creates a marking menu that allows the user
  203. // to select Component masks. It reuses
  204. // the name tempMM for the name of the menu, to
  205. // ensure that there's only one of these at
  206. // any one time.
  207. {
  208.     if( `popupMenu -exists tempMM` )
  209.     {
  210.         deleteUI tempMM;
  211.     }
  212.  
  213.     global string $gSelect;
  214.     setToolTo $gSelect;
  215.  
  216.     selectMode -component;
  217.  
  218.     popupMenu -sh 1 -mm 1 -b 1 -aob 1 -p viewPanes -pmc "doSelectComponentMM" tempMM;
  219.  
  220. }
  221.